package com.putao.album.photodetail;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.ArrayList;

/**
 * Created by chen on 15-6-5.
 */
public class PhotoViewFragmentAdapter extends FragmentStatePagerAdapter {
    private ArrayList<PhotoViewFragment> mFragments;

    public PhotoViewFragmentAdapter(FragmentManager fm, ArrayList<PhotoViewFragment> fragments) {
        super(fm);
        mFragments = fragments;
    }

    @Override
    public PhotoViewFragment getItem(int i) {
        return mFragments == null ? null : mFragments.get(i);
    }

    @Override
    public int getCount() {
        return mFragments == null ? 0 : mFragments.size();
    }

    public void setmFragments(ArrayList<PhotoViewFragment> mFragments) {
        this.mFragments = mFragments;
    }
}